package com.oocl.tm.service.impl;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;

import com.oocl.tm.dao.ClientsDao;
import com.oocl.tm.dao.impl.ClientsDaoImpl;
import com.oocl.tm.log4j.Log4j;
import com.oocl.tm.protocol.MsgPackage;
import com.oocl.tm.repository.ClientsDBFactory;
import com.oocl.tm.service.LoginService;

public class LoginServiceImpl implements LoginService{
	
	private OutputStream out;
	private MsgPackage mp;
	private ClientsDao clientsDao;
	
	public LoginServiceImpl(OutputStream out,MsgPackage mp) {
		this.out = out;
		this.mp = mp;
		clientsDao = new ClientsDaoImpl();
	}

	public void recordOnline() {
		clientsDao.recordOnline(mp.getSender());
	}
	
	@Override
	public void refreshOutputs(){
		clientsDao.insertAnOutput(mp.getSender(), out);
	}
	
	
	
}
